﻿#include <iostream>
#include <thread>
using namespace std;
void worker(int n) {
	cout << "
		⼦线程开启
		" << this_thread::get_id()<<endl;
		for (int i = 0; i < n; ++i) {
			cout << i << endl;
		}
	cout << "
		⼦线程结束
		" <<this_thread::get_id()<<endl;
}
int main()
{
	cout << "
		主线程开启
		"  <<this_thread::get_id()<<endl;
		int N = 10;
	thread t(worker, N);
	t.join();
	cout << "
		主线程结束
		"  <<this_thread::get_id() <<endl;
}